//
//  SessionMessageCell.h
//  AirMessage
//
//  Created by 陈区 on 13-2-5.
//  Copyright (c) 2013年 陈区. All rights reserved.
//

#import "MessageModel.h"

#pragma mark -单元格参数设置

//单元格的最小的宽度
#define IM_CELL_MIN_WIDTH 47

//单元格最小的高度
#define IM_CELL_MIN_HEIGHT 39

//单元格最大的宽度
#define IM_CELL_MAX_WIDTH ([[UIScreen mainScreen] bounds].size.width - 56 - 82)

//单元格上下面空白空间 ???
#define IM_CELL_TOP_CAP_HEIGHT 0

//头像的高宽
#define IM_HEADER_IMAGE_WIDTH_HEIGHT 36

//左侧头像距离左边缘的宽度
#define IM_HEADER_IMAGE_LEFT_CAP_WIDTH 15

//右侧头像距离右侧边缘的宽度
#define IM_HEADER_IMAGE_RIGHT_CAP_WIDTH 15

//头像和气泡之间的距离
#define IM_HEADER_IMAGE_BUBBLE_CAP_WIDTH 5

//左侧气泡图片横向拉伸点
#define IM_LEFT_BUBBLE_IMAGE_LEFT_CAP_WIDTH 35

//左侧气泡图片竖向拉伸点
#define IM_LEFT_BUBBLE_IMAGE_TOP_CAP_HEIGHT 35

//右侧气泡图片横向拉伸点
#define IM_RIGHT_BUBBLE_IMAGE_LEFT_CAP_WIDTH 35

//右侧气泡图片竖向拉伸点
#define IM_RIGHT_BUBBLE_IMAGE_TOP_CAP_HEIGHT 35

//图片的高度
#define IM_PHOTO_HEIGHT 98

@class SessionMessageCell;

@interface BgImageView : UIImageView
@property (nonatomic, assign) SessionMessageCell* parentCell;

@end





//消息发送者类型
typedef enum {
    kMessageSenderTypeMe, //自己是发送着
    kMessageSenderTypeAnother, //别人是发送者
    kMessageSenderTypeChatGroupOperateNotice, //群组通知
    kMessageSenderTypeChatGroupAuditNotice //群审核通知
} MessageSenderType;


@protocol SessionMessageCellDelegete <NSObject>
//cell的头部
- (UIView*)sessionMessageCell:(SessionMessageCell*)aMsgCell viewForHeaderInCell:(NSIndexPath*)index;

@end

@interface SessionMessageCell : UITableViewCell  {
    NSIndexPath* index;
    
    UIView* headerView; //单元格头文件容器
    
    UIView* contentViewCell; //单元格内容容器
    BgImageView* bubbleImageView; //气泡
    SEGLabel* lbMsgBody; //消息体
    UIImageView* btnHeadImage; //头像
    UIImageView* showImage; //显示发送或接收的图片
    UIImageView* imgVSentStatus; //消息发送状态
}

@property (nonatomic, weak) id<SessionMessageCellDelegete> cellDelegate;
@property (nonatomic, retain) BgImageView* bubbleImageView;
@property (nonatomic, retain) SEGLabel* lbMsgBody;
@property (nonatomic, retain) UIImageView* btnHeadImage;
@property (nonatomic, retain) UIImageView* showImage;
@property (nonatomic, retain) UIImageView* imgPlay;
@property (nonatomic, retain) UIImageView* imgVSentStatus;
@property (nonatomic, retain) NSIndexPath* index;
@property (nonatomic, retain) UIView* headerView;
@property (nonatomic, retain) UIView* contentViewCell;

@property (nonatomic, retain) MessageModel* messageModel;

@property (nonatomic, retain) NSDictionary* dataDic;

- (void)reloadMessage:(MessageModel*)aMessage;

@end
